package com.project.lk.nurseapp.nurse.doctorapply.presenter;

import com.project.lk.nurseapp.base.BaseApi;
import com.project.lk.nurseapp.base.BasePresenter;
import com.project.lk.nurseapp.base.ModelPresenterBridge;
import com.project.lk.nurseapp.nurse.doctorapply.model.ApplyBean;
import com.project.lk.nurseapp.nurse.doctorapply.model.ApplyModel;
import com.project.lk.nurseapp.nurse.doctorapply.model.DoctorApplyInfoBean;
import com.project.lk.nurseapp.nurse.doctorapply.model.DoctorApplyInfoModel;

import java.util.List;

/**
 * 功能介绍：
 * 项目名：
 * 模块名称：
 * 作者：LK
 * 日期：2018/1/9
 * 修改日期：
 */
public class DoctorApplyPresenter extends BasePresenter<IDoctorApplyView> implements ModelPresenterBridge{

//    DoctorApplyInfoModel applyInfoModel;
    ApplyModel applyModel;
    public DoctorApplyPresenter(IDoctorApplyView view){
        addView(view);
//        applyInfoModel=new DoctorApplyInfoModel();
        applyModel=new ApplyModel();
        applyModel.setBridge(this);
//        applyInfoModel.setBridge(this);
    }

//    public void getInfoData(String url,String senderId){
//        applyInfoModel.postLoadJson(url,senderId);
//    }

//    public List<DoctorApplyInfoBean> getInfoList(){
//        return applyInfoModel.getmList();
//    }
    public void applyMoney(String url,String baseDoctorInfoId,String userConponId,String sessionId,String payMentWay){
        applyModel.postLoadJson(url,baseDoctorInfoId,userConponId,sessionId,payMentWay);
    }
    public List<ApplyBean> getAliPayList(){
        return applyModel.getPayList();
    }


    @Override
    public void bridge(int action, List list) {

        if (view!=null) {
            switch (action){

                case BaseApi.apply_ticket_success:
                    view.applyTicketSuccess();
                    break;
                case BaseApi.order_apply_success:
                    view.orderApplySuccess();
                    break;
                case BaseApi.order_apply_fail:
                    view.orderApplyFail();
                    break;
            }
        }
    }
}
